﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="IssueTrackerMvcWeb.Views.Home.Index" %>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>My Task List</h2>
    <p />
    <h3><%=ViewData.Model.Message %></h3>
    <table>
        <tr>
            <td>Description</td>
            <td>State</td>
            <td></td>
        </tr>
        <%foreach (var issue in ViewData.Model.TaskList)
          { %>
          <tr>
            <td><%=issue.Description %></td>
            <td><%=issue.CurrentStateName %></td>
            <td>
                <!-- There are 3 ways to create links -->
                <!-- You can also use ActionLink(of Type) with Lambda expression -->
                <%=Html.ActionLink("Edit", "Edit", new { id = issue.Id })%>
                <%=Html.ActionLink("Delete", "Delete", new { id = issue.Id })%>
            </td>
          </tr>
        <%} %>
    </table>
    <p>
        <%=Html.ActionLink("Report New Issue", "Add", "Home")%>
    </p>
</asp:Content>
